deserializeConfig
fun <T : Any> deserializeConfig(config: T, string: String, errorBuilder: MutableList<String>, flags: Byte = 1): ValidationResult<ConfigContext<T>>
Deserializes a config from a string.
Extension of deserializeFromToml that deserializes directly from a string. Use to read from a file or packet.
Return
Returns ValidationResult of ConfigContext. The validation result includes the config and any applicable errors, and any flag information
Author
fzzyhmstrs
Since
0.2.0
Parameters
T
the config type. can be Any non-null type.
config
the config pre-deserialization
string
the string to deserialize from. Needs to be valid Toml.
errorBuilder
a mutableList of strings the original caller of deserialization can use to print a detailed error log
ignoreNonSync
default true. If false, elements with the NonSync annotation will be skipped. Use true to deserialize the entire config (ex: loading from file), use false for syncing (ex: initial sync server -> client)